J operator
In computer science, Peter Landin's J operator is a programming construct that post-composes a lambda expression with the continuation to the current lambda-context. The resulting “function” is first-class and can be passed on to subsequent functions, where if applied it will return its result to the continuation of the function in which it was created.
Generalized first-class return
One can define the return statement as a first-class object by taking the J of the identity function. It can then be passed on to other functions and applied there to return from the function in which the “return” was created.
See also
References
- By Landin
- Landin, P.J., “The Mechanical evaluation of expressions,” Comp. J. 6, pp. 308–320.
- Landin, P.J., “A Correspondence between Algol 60 and Church’s Lambda-notation,” Comm. ACM 8, 89–101, 158–165, 1965.
- Landin, P.J., “A formal description of Algol 60.” Presented at IFIP Working Conf., Baden, Sept. 1964.
- Landin, P.J., “Programming without lmperatives—an Example,” UNIVAC S.P. Research Report (March, 1965)
- Landin, P.J., “Getting Rid of Labels,” UNIVAC S.P. Research Report (July, 1965)
- Landin, P.J., “An Analysis of Assignment in Programming Languages,” UNIVAC S.P. Research Report (September, 1965)
- By others
- Thielecke, Hayo. An Introduction to Landin’s “A Generalization of Jumps and Labels”, Higher-Order and Symbolic Computation, 11(2):117-123, 1998.
- Danvy, Olivier and Millikin, Kevin. A Rational Deconstruction of Landin's SECD Machine with the J Operator, Logical Methods in Computer Science, Volume 4, Issue 4, Paper 12, 2008.
- Danvy, Olivier, Chung-Chieh Shan and Ian Zerny. J is for Javascript: A direct-style correspondence between Algol-like languages and JavaScript using first-class continuations.